home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Super CD
/
Super CD.iso
/
geomitri
/
acad10
/
mc.doc
< prev
next >
Wrap
Text File
|
1988-07-28
|
5KB
|
120 lines
AutoCAD Menu Compiler
by Kelvin R. Throop
Revision 2 -- October 22, 1985
The AutoCAD menu compiler makes the previously tedious and error prone
task of constructing tablet menus merely boring and unforgiving. It
eliminates the need to duplicate text in many locations when using
"large boxes" on a tablet, and removes the need to count lines by hand
when placing information in a menu file. In addition, a powerful
macro facility is provided which allows commonly used substrings to be
expanded automatically. This facility makes configurable menus
possible and reduces retyping. The output of the menu compiler is a
.MNU file compatible with AutoCAD 2.0 and up.
USING THE MENU COMPILER
The menu compiler is invoked with the command:
MC <file> [options]
where <file> is the name of the menu definition file to be processed,
specified without the file type. The input menu definition file
should have a file type of ".MND", and the output menu will be written
with file type ".MNU", overwriting any previous file with this name.
Options are specified as "-<letter>", and are as follows:
-D Dump macro definitions
-I List input
-M Disable macro facility
-? Print a help message
THE MENU DEFINITION FILE
An AutoCAD menu is composed of sections, such as "TABLET1", "BUTTONS",
and "SCREEN", and user-defined submenus. The menu definition file is
a compact form of specifying a menu file. If none of the features
provided by the menu compiler are used, the output file will be
identical to the input. You may run the AutoCAD standard menu through
the menu compiler to prove this to yourself.
There are two major features offered by the menu compiler: multiple
line items and macros. These features are completely separate and
will be discussed separately.
Multiple Line Items
In a tablet menu, large boxes are frequently used to invoke commonly
used commands. A large box is actually made of up several smaller
boxes. AutoCAD doesn't "know" about this large box as a separate
item--the large box is implemented simply by duplicating the menu
command text in each of the smaller boxes which make up the large box.
Before the menu compiler, this meant placing the command lines in
multiple places in the file, counting lines from the start of the
section by hand. Now you can say:
<number,number,...>Command
and the "Command" will be placed automatically at the specified lines
in the file. For example, if the REDRAW command is to be placed in
boxes 20, 21, 22, 98, 99, 100, 141, 142, 143 in the menu, you would
say:
<20,21,22,98,99,100,141,142,143>REDRAW
and the menu compiler will automatically place REDRAW on each of the
specified lines of the section. You may use regular commands within
one section (for a screen menu, say), and multiple line commands
within another. Mixing command types within a section is probably an
error and will generate a diagnostic from the menu compiler. To place
text on a single line, just specify one number before it:
<33>QUIT
Macros
The menu compiler allows commonly used text to be stored in macros and
inserted by name at any place within the menu. To define a macro, use
a command of the form:
{macname}=text
where "macname" is the name of the macro (1 to 31 characters, case
insensitive) and "text" is the text value of the macro. The macro
definition must start in column 1 of the line. A macro may be invoked
anywhere within the text just by naming it within braces. For
example, if you have defined:
{animal1}=cat
{animal2}=rat
the text line:
<12,35>The {animal1} saw the {animal2}.
will place the command "The cat saw the rat." on lines 12 and 35 of
the section.
A macro definition cannot span more than one line. Maximum line length
is 132 characters.
Macros may be used recursively. For example, you may define:
{default}=LAYER SET 0 COLOR BYLAYER LINETYPE SET BYLAYER SNAP .25
{reset}=ZOOM A {default} GRID ON
and then say:
<1,2,13,14>{reset} SAVE
If you create an infinite recursion loop, the menu compiler will give
up after the menu item grows to more than 900 characters, issue a
diagnostic, and replace the offending line in the output menu with a
line which indicates which macro was being evaluated when the cow fell
through the roof.
If you have information within braces and don't want the macro
expansion to process it, you may disable macro expansion altogether by
setting the -M switch on the command line.